<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>{% block title %} - Sobremesa{% endblock %}</title>
    <link rel="shortcut icon" href="{% static 'favicon.png' %}">
    <link rel="stylesheet" href="{% static 'plugins/layui/css/layui.css' %}">
    {% block header %}

    {% endblock %}
</head>
<body class="layui-layout-body">

<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">Sobremesa 内容管理</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="{% url 'front:index' %}">站点</a></li>
            <li class="layui-nav-item"><a href="{% url 'cms:index' %}">控制台</a></li>
            <li class="layui-nav-item">
                <a href="javascript:;">其它</a>
                <dl class="layui-nav-child">
                    <dd><a href="#">邮件管理</a></dd>
                    <dd><a href="#">消息管理</a></dd>
                    <dd><a href="#">授权管理</a></dd>
                </dl>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="{{ request.user.avatar }}" class="layui-nav-img">
                    {{ request.user.username }}
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="#">基本资料</a></dd>
                    <dd><a href="#">安全设置</a></dd>
                    <dd><a href="{% url 'front:logout' %}">退了</a></dd>
                </dl>
            </li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree menu" lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a href="javascript:;">内容管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="{% url 'cms:publish' %}">新发布</a></dd>
                        <dd><a href="{% url 'cms:posts' %}">发布管理</a></dd>
                        <dd><a href="{% url 'cms:topics_add' %}">新话题</a></dd>
                        <dd><a href="{% url 'cms:topics' %}">话题管理</a></dd>
                        {% if request.user.is_superuser %}
                            <dd><a href="{% url 'cms:types' %}">类目管理</a></dd>
                            <dd><a href="javascript:;">用户管理</a></dd>
                            <dd><a href="javascript:;">权限管理</a></dd>
                        {% endif %}
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;">
            {% block main %}

            {% endblock %}
        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © layui.com - 底部固定区域
    </div>
</div>
<script src="{% static 'plugins/layui/layui.all.js' %}"></script>
<script src="{% static 'js/cms/common.min.js' %}"></script>
{% block footer %}

{% endblock %}
</body>
</html>